const express = require('express')
const history = require('connect-history-api-fallback')
console.log(history)
const app = express()

app.use(history())
app.use(express.static(__dirname+'/static'))

app.get('/person', (request, reponse) => {
  reponse.send({
    name: 'tom',
    age: 18
  })
})

app.listen(5005, (err) => {
  if(!err) console.log('服务器启动成功了')
})

// history 刷新路由，页面不见了；hash 页面没事，hash值不会带给服务器。